import {useCallback} from "react";
import {View} from "@tarojs/components";
import styles from './index.module.scss';

interface Props{
  title: string;
  onClick: (title: string)=>void;
}

export function SearchItem(props: Props){

  const _onClick = useCallback(()=>{
    props.onClick(props.title);
  }, [props]);

  return (
    <View className={styles.wrapper} onClick={_onClick}>
      {props.title}
    </View>
  );
}
